package ssf.app.service;

import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.dao.EmptyResultDataAccessException;
import ssf.core.common.PagingList;


public class EmployeeService extends BaseService
{
   
	private static final String SQL_GET_ALL_EMPLOYEES = "select * from pioneer_employee";
   
    public PagingList getAllEmployees(HttpServletRequest request)
    {
        return getPagingList(SQL_GET_ALL_EMPLOYEES, request);
    }
    
    
    private static final String SQL_ADD_EMPLOYEE = "insert into pioneer_employee(empName,empRealName,empSex,empBirth,empLeve,empDep,empSpe,empClass,empPhone,empQq,empEmail,introduction,org,tec) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
   
    public void addEmployee(String empName, String empRealName, String empSex, String empBirth, String empLeve, String empDep, String empSpe, 
            String empClass, String empPhone, String empQq, String empEmail, String introduction, String org, String tec)
    {
        jt.update(SQL_ADD_EMPLOYEE, new Object[] {
            empName, empRealName, empSex, empBirth, empLeve, empDep, empSpe, empClass, empPhone, empQq, 
            empEmail, introduction, org, tec
        });
    }
    

    private static final String SQL_GETDETAIL_EMPLOYEE = "select * from pioneer_employee where empId = ?";

    public Map showDetail(String empId)
    {
        return jt.queryForMap(SQL_GETDETAIL_EMPLOYEE, new Object[] {
            empId
        });
    }


}
